<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="index.xhtml">
	<ui:define name="conteudo">
		<f:view>
			<h:form id="form">
				<p:growl id="msgs" life="2000" />

				<p:panel header="Cadastrar Cliente">
					<h:panelGrid columns="2" id="grid">

						<h:outputText value="Nome : * " />
						<p:inputText required="true" label="nome" size="60"
							value="#{ClienteBean.cliente.nome}" />

						<h:outputText value=" Data de Nascimento : *" />
						<p:calendar navigator="none"
							value="#{ClienteBean.cliente.dataNascimento}" />


						<h:outputText value=" RG : *" />
						<p:inputMask required="true" mask="9.999.999-9" label="rg"
							value="#{ClienteBean.cliente.rg}" />

						<h:outputText value=" CPF : *" />
						<p:inputMask required="true" mask="999.999.999-99" label="cpf"
							size="15" value="#{ClienteBean.cliente.cpf}" />

						<h:outputText value=" Bairro: *" />
						<p:inputText required="true" label="bairro" size="40"
							value="#{ClienteBean.endereco.bairro}" />

						<h:outputText value=" Logradouro: *" />
						<p:inputText required="true" label="logradouro" size="40"
							value="#{ClienteBean.endereco.logradouro}" />

						<h:outputLabel for="estado" value="Estado: *" />
						<h:selectOneMenu value="#{ClienteBean.idEstado}">
							<f:selectItem itemValue="" itemLabel="Selecione..." />
							<f:selectItems value="#{EstadoBean.estados}" />
						</h:selectOneMenu>

						<h:outputLabel for="cidade" value=" Cidade: *" />
						<h:selectOneMenu value="#{ClienteBean.idCidade}">
							<f:selectItem itemValue="" itemLabel="Selecione..." />
							<f:selectItems value="#{CidadeBean.cidades}" />
						</h:selectOneMenu>



						<p:commandButton value="Limpar" type="reset" />
						<p:commandButton id="btn_incluir" value="Incluir" update="msgs @parent" action="#{ClienteBean.incluirCliente}" ajax="false"></p:commandButton>
						<p:commandButton id="btn_voltar" value=" Voltar" onclick="index.jsf"></p:commandButton>

					</h:panelGrid>

				</p:panel>
			</h:form>
		</f:view>
	</ui:define>
</ui:composition>
</html>